package com.sckj.springboot.controller;

import com.sckj.springboot.config.Person;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Controller
@ConfigurationProperties(prefix = "person")
public class ConfigController {
//    @Resource
//    private Person person;

//    @Value("${person.name}")
//    private String name;
//
//    @Value("${city.cityList}")
//    private String[] cityList;
//
//    @Value(value = "#{person.lists}")
//    public List<String> lists;
//
//    @RequestMapping("/hello")
//    public String sayhello(){
//        return name;
//    }
//
//
//    @RequestMapping("/sayhello")
//    public String hello(){
//        return "hello\t" + cityList[0] + "hello\t" + cityList[1] + "hello\t" + cityList[2];
//    }
//
//
//    @RequestMapping("/saylists")
//    public List<String> saylist(){
//        return lists;
//    }

    private String name;
    private Integer age;

    @RequestMapping("/quick")
    public String quick(){
        return "welcome" + name +age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
